<template>
  <div>
    <button @click="counter++">+1</button>
    <p>计数器：{{ counter }}</p>
  </div>
  <button @click="changeAge">年龄+1</button>
  <div>
    <A />
    <B />
  </div>
</template>

<script setup>
// const counter = useState("counter", () => 0);
// const counter = ref(Math.random() * 10 + 1);
const counter = useState("counter", () => Math.random() * 10 + 1);
const stuInfo = useStuInfo();
const changeAge = () => {
  stuInfo.value.age++;
};
</script>
